package com.ams.thread.lesson3;

import lombok.extern.slf4j.Slf4j;

/**
 * @author： 乐哥聊编程(全平台同号)
 */
@Slf4j
public class Example13 {
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void main(String[] args) {
        threadLocal.set(1000);
        log.info(threadLocal.get() + "");
        threadLocal.remove();
        // 执行remove后，就获取不到了
        log.info(threadLocal.get() + "");
    }
}
